﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PDFDesign.Model.Const;

namespace PDFDesign.Model
{
    /// <summary>
    /// 单元格
    /// </summary>
    public class CellControl
    {
        /// <summary>
        /// 单元格宽度
        /// </summary>
        [JsonProperty("width")]
        public float Width { get; set; }
        /// <summary>
        /// 单元格高度
        /// </summary>
        [JsonProperty("height")]
        public float Height { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }
        /// <summary>
        /// 绑定信息
        /// </summary>
        [JsonProperty("text")]
        public string Text { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        [JsonProperty("caption")]
        public string Caption { get; set; }
        /// <summary>
        /// 是否显示标题
        /// </summary>
        [JsonProperty("showCaption")]
        public bool ShowCaption { get; set; }
        /// <summary>
        /// 父表头
        /// </summary>
        [JsonProperty("isFather")]
        public bool IsFather { get; set; }
        /// <summary>
        /// 水平对齐方式
        /// </summary>
        [JsonProperty("align")]
        [JsonConverter(typeof(StringEnumConverter))]
        public Align Align { get; set; } = Align.left;
        /// <summary>
        /// 垂直对齐方式
        /// </summary>
        [JsonProperty("valign")]
        [JsonConverter(typeof(StringEnumConverter))]
        public VAlign VAlign { get; set; } = VAlign.top;
        /// <summary>
        /// 字体属性
        /// </summary>
        [JsonProperty("font")]
        public Font2 Font { get; set; }
    }
}